package com.lizx.persional.common.config;

import com.lizx.persional.common.filter.CorsFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.core.annotation.Order;

/**
 * @Author 江苏博沣
 * @Description
 * @Date Create in 2018/2/28 11:20
 */

public class FilterConfig {
    @Bean
    @Order(0)
    public FilterRegistrationBean corsFilter() {
        FilterRegistrationBean registration = new FilterRegistrationBean();
        registration.setFilter(new CorsFilter());
        registration.addUrlPatterns("/persional/*");
        registration.setName("corsFilter");
        registration.setOrder(0);
        return registration;
    }
}
